home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
mawk10.zip
/
MAWK_TES.V7
< prev
next >
Wrap
Text File
|
1991-10-05
|
2KB
|
101 lines
: 'This is a simple test that a new made mawk seems to'
: 'be working OK.'
: 'It is certainly not exhaustive, but the last two tests in'
: 'particular use most features.'
:
: 'It needs to be run from mawk/test'
: 'and mawk needs to be in PATH'
:
dat=mawk_test.dat
trap 'echo mawk_test failed ; rm -f temp$$ ; exit 1' 0
: 'find out which mawk we are testing'
./mawk -V
echo testing input and field splitting
./mawk -f wc.awk $dat > temp$$
( cat | cmp -s - temp$$ ) <<@@
107 479
@@
[ $? = 0 ] || exit
echo input and field splitting OK
echo
echo testing regular expression matching
./mawk -f reg0.awk $dat > temp$$
./mawk -f reg1.awk $dat >> temp$$
./mawk -f reg2.awk $dat >> temp$$
( cat | cmp -s - temp$$ ) <<@@
3
4
1
@@
[ $? = 0 ] || exit
echo regular expression matching OK
echo
echo testing arrays and flow of control
./mawk -f wfrq0.awk $dat > temp$$
( cat | cmp -s - temp$$ ) <<@@
29 p
21 A
14 ANODE
13 q
12 d
12 sval
10 if
10 the
8 dlink
8 is
8 h
7 to
6 of
6 D
5 hash
5 deleted
5 else
5 link
5 front
5 cflag
@@
[ $? = 0 ] || exit
echo array test OK
echo
echo testing function calls and general stress test
./mawk -f ../examples/decl.awk $dat > temp$$
( cat | cmp -s - temp$$ ) <<'@@'
hash: function returning unsigned (extern)
last_dhash: unsigned (static)
A: ARRAY
sval: pointer to STRING
cflag: int
A: ARRAY
d: double
cflag: int
ap: pointer to ANODE
signal: function returning pointer to function returning void
@@
[ $? = 0 ] || exit
echo general stress test passed
echo
echo tested mawk seems OK
trap 0
rm -f temp$$
exit 0